package com.kinoshita.common.status;


public enum StatusCode  {

    SYSTEM_SUCCESS(200, "操作成功"),

    NOT_LOGIN(401, "未登陆"),

    UNAUTHORIZED_EXCEPTION(403, "权限不足"),

    SYSTEM_EXCEPTION(500, "系统繁忙"),

    SYSTEM_COPY_OBJECT_ERROR(500, "复制对象错误"),

    SERVICE_UNAVAILABLE(503, "流量已满"),

    SYSTEM_INCORRECT_PARAM(504, "参数错误"),

    REQUEST_PARAM_ERROR(505, "请求参数错误"),
    /**
     * 用户相关状态码
     */
    USER_ADD_ERROR(1001, "添加用户失败"),

    USER_EDIT_ERROR(1002, "修改用户失败"),

    USER_DELETE_ERROR(1003, "删除用户失败"),

    USER_GET_ERROR(1004, "获取用户失败"),

    USER_LIST_ERROR(1005, "获取用户列表失败"),

    USER_DOES_NOT_EXIST(1006, "用户名不存在"),

    USER_EDIT_PASSWORD_ERROR(1007, "用户修改失败"),

    USER_NAME_IS_EXIST(1008, "用户名已存在"),

    USER_IS_NO_EXIST(1009, "用户不存在"),

    USER_ACCOUNT_PASSWORD_ERROR(1010, "账号密码错误"),

    USER_NAME_NOT_NULL(1011, "用户名不能为空"),


    /**
     * 系统角色状态码
     */
    ROLE_ADD_ERROR(2001, "添加角色失败"),

    ROLE_EDIT_ERROR(2002, "修改角色失败"),

    ROLE_DELETE_ERROR(2003, "删除角色失败"),

    ROLE_GET_ERROR(2004, "获取角色失败"),

    ROLE_LIST_ERROR(2005, "获取角色列表失败"),

    ROLE_BIND_USER_ERROR(2006, "用户绑定角色失败"),

    ROLE_UNBIND_USER_ERROR(2007, "用户解除绑定角色失败"),

    ROLE_ALREADY_OWN_THIS_PERMISSION(2008, "用户已经拥有该权限"),

    ROLE_ALREADY_OWN(2009, "用户已经拥有角色"),


    /**
     * 系统权限状态码
     */
    PERMISSION_ADD_ERROR(3001, "添加权限失败"),

    PERMISSION_EDIT_ERROR(3002, "修改权限失败"),

    PERMISSION_DELETE_ERROR(3003, "删除权限失败"),

    PERMISSION_GET_ERROR(3004, "获取权限失败"),

    PERMISSION_LIST_ERROR(3005, "获取权限列表失败"),

    PERMISSION_BIND_ROLE_ERROR(3006, "角色绑定权限失败"),

    PERMISSION_UNBIND_ROLE_ERROR(3007, "角色全部权限解除绑定失败"),

    PERMISSION_GET_NODE_LIST_ERROR(3008, "角色全部权限解除绑定失败"),

    PERMISSION_NO_ANY(3009, "角色没有任何权限"),

    PERMISSION_DELETE_SUB_ERROR(3010, "删除子权限失败");

    private int     code = 0;

    private String  msg = "";

    private StatusCode() {

    }

    private StatusCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}

